package com.boot.web;

import com.boot.domain.*;
import com.boot.resp.Response;
import com.boot.service.OrgService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * @author wwj
 */

@RestController
@RequestMapping(value = "/screenfixth")
public class ScreenSixthController {

    @Resource
    private OrgService orgServiceImpl;

    @RequestMapping(value = "/getOrgCompetitiveByOrgCode")
    public Response<Object> getOrgCompetitiveByOrgCode(HttpServletRequest request){
        Response<Object> response = null;
        response = new Response<Object>(200, "前10年企业竞争力指数");
        List<OrgCompetitive> list = orgServiceImpl.getOrgCompetitiveByOrgCode(request.getParameter("orgCode"));
        response.setData(list);
        return response;
    }

    @RequestMapping(value = "/getOrgEachCompetitiveByOrgCode")
    public Response<Object> getOrgEachCompetitiveByOrgCode(HttpServletRequest request){
        Response<Object> response = null;
        response = new Response<Object>(200, "去年质量竞争力指数 及各级指标得分");
        List<OrgEachCompetitive> list = orgServiceImpl.getOrgEachCompetitiveByOrgCode(request.getParameter("orgCode"));
        response.setData(list);
        return response;
    }

    @RequestMapping(value = "/getAnalysisReportByOrgCode")
    public Response<Object> getAnalysisReportByOrgCode(HttpServletRequest request){
        Response<Object> response = null;
        response = new Response<Object>(200, "该企业质量分析报告");
        String report = orgServiceImpl.getAnalysisReportByOrgCode(request.getParameter("orgCode"));
        response.setData(report);
        return response;
    }

    @RequestMapping(value = "/getAnalysisReportByIndustryCode")
    public Response<Object> getAnalysisReportByIndustryCode(HttpServletRequest request){
        Response<Object> response = null;
        response = new Response<Object>(200, "该行业质量分析报告");
        String report = orgServiceImpl.getAnalysisReportByIndustryCode(request.getParameter("industryCode"));
        response.setData(report);
        return response;
    }

    @RequestMapping(value = "/getAllZone")
    public Response<Object> getAllZone(HttpServletRequest request){
        Response<Object> response = null;
        response = new Response<Object>(200, "衡水市各市县");
        List<Zone> list = orgServiceImpl.getAllZone();
        response.setData(list);
        return response;
    }

    @RequestMapping(value = "/getAllIndustry")
    public Response<Object> getAllIndustry(HttpServletRequest request){
        Response<Object> response = null;
        response = new Response<Object>(200, "衡水市各行业");
        List<Industry> list = orgServiceImpl.getAllIndustry();
        response.setData(list);
        return response;
    }

    @RequestMapping(value = "/getOrgByZoneAndIndustry")
    public Response<Object> getOrgByZoneAndIndustry(HttpServletRequest request){
        Response<Object> response = null;
        response = new Response<Object>(200, "根据区域code和行业code获得企业列表");
        List<Organization> list = orgServiceImpl.getOrgByZoneAndIndustry(request.getParameter("zoneCode"),request.getParameter("industryCode"));
        response.setData(list);
        return response;
    }

    @RequestMapping(value = "/getSalesVolumeByOrgCode")
    public Response<Object> getSalesVolumeByOrgCode(HttpServletRequest request){
        Response<Object> response = null;
        response = new Response<Object>(200, "企业销售额、年产值年度分布");
        List<SalesVolume> list = orgServiceImpl.getSalesVolumeByOrgCode(request.getParameter("orgCode"));
        response.setData(list);
        return response;
    }

    @RequestMapping(value = "/getSalesVolumeByIndustryCode")
    public Response<Object> getSalesVolumeByIndustryCode(HttpServletRequest request){
        Response<Object> response = null;
        response = new Response<Object>(200, "行业销售额、年产值年度分布");
        List<SalesVolume> list = orgServiceImpl.getSalesVolumeByIndustryCode(request.getParameter("county"),request.getParameter("industryCode"));
        response.setData(list);
        return response;
    }

    @RequestMapping(value = "/getSalesTurnoverByOrgCode")
    public Response<Object> getSalesTurnoverByOrgCode(HttpServletRequest request){
        Response<Object> response = null;
        response = new Response<Object>(200, "营业额和纳税金额");
        List<SalesTurnover> list = orgServiceImpl.getSalesTurnoverByOrgCode(request.getParameter("orgCode"));
        response.setData(list);
        return response;
    }

    @RequestMapping(value = "/getSalesTurnoverByIndustryCode")
    public Response<Object> getSalesTurnoverByIndustryCode(HttpServletRequest request){
        Response<Object> response = null;
        response = new Response<Object>(200, "行业营业额和纳税金额");
        List<SalesTurnover> list = orgServiceImpl.getSalesTurnoverByIndustryCode(request.getParameter("county"),request.getParameter("industryCode"));
        response.setData(list);
        return response;
    }

    @RequestMapping(value = "/getQualityCreditByOrgCode")
    public Response<Object> getQualityCreditByOrgCode(HttpServletRequest request){
        Response<Object> response = null;
        response = new Response<Object>(200, "质量信用评价");
        List<QualityCredit> list = orgServiceImpl.getQualityCreditByOrgCode(request.getParameter("orgCode"));
        response.setData(list);
        return response;
    }

    @RequestMapping(value = "/getQualityCreditByIndustryCode")
    public Response<Object> getQualityCreditByIndustryCode(HttpServletRequest request){
        Response<Object> response = null;
        response = new Response<Object>(200, "行业质量信用评价");
        List<QualityCredit> list = orgServiceImpl.getQualityCreditByIndustryCode(request.getParameter("county"),request.getParameter("industryCode"));
        response.setData(list);
        return response;
    }

    @RequestMapping(value = "/getProductionLicenseByOrgCode")
    public Response<Object> getProductionLicenseByOrgCode(HttpServletRequest request){
        Response<Object> response = null;
        response = new Response<Object>(200, "工业产品生产许可证");
        Map map = orgServiceImpl.getProductionLicenseByOrgCode(request.getParameter("orgCode"));
        response.setData(map);
        return response;
    }

    @RequestMapping(value = "/getProductionLicenseByIndustryCode")
    public Response<Object> getProductionLicenseByIndustryCode(HttpServletRequest request){
        Response<Object> response = null;
        response = new Response<Object>(200, "行业工业产品生产许可证");
        Map map = orgServiceImpl.getProductionLicenseByIndustryCode(request.getParameter("county"),request.getParameter("industryCode"));
        response.setData(map);
        return response;
    }

    @RequestMapping(value = "/getProportionByOrgCode")
    public Response<Object> getProportionByOrgCode(HttpServletRequest request){
        Response<Object> response = null;
        response = new Response<Object>(200, "企业工程技术人员 比重指标");
        List<Proportion> list = orgServiceImpl.getProportionByOrgCode(request.getParameter("orgCode"));
        response.setData(list);
        return response;
    }

    @RequestMapping(value = "/getProportionByIndustryCode")
    public Response<Object> getProportionByIndustryCode(HttpServletRequest request){
        Response<Object> response = null;
        response = new Response<Object>(200, "行业工程技术人员 比重指标");
        List<Proportion> list = orgServiceImpl.getProportionByIndustryCode(request.getParameter("county"),request.getParameter("industryCode"));
        response.setData(list);
        return response;
    }

    @RequestMapping(value = "/getConsumeByOrgCode")
    public Response<Object> getConsumeByOrgCode(HttpServletRequest request){
        Response<Object> response = null;
        response = new Response<Object>(200, "机构能源计量分析");
        Map map = orgServiceImpl.getConsumeByOrgCode(request.getParameter("orgCode"));
        response.setData(map);
        return response;
    }

    @RequestMapping(value = "/getConsumeByIndustryCode")
    public Response<Object> getConsumeByIndustryCode(HttpServletRequest request){
        Response<Object> response = null;
        response = new Response<Object>(200, "行业能源计量分析");
        Map map = orgServiceImpl.getConsumeByIndustryCode(request.getParameter("county"),request.getParameter("industryCode"));
        response.setData(map);
        return response;
    }
}